<template>
	<view class="container">
		<view class="user-page">
			<!-- <image class="bg" src="/static/user-bg.jpg"></image> -->
			<view class="user-info-box">
				<view class="member-top-c">
					<view v-if="userDetailInfo && userDetailInfo.id">
						<view class="user-wrap" style="display: flex;align-items: center;">
							<image class="portrait" mode="aspectFill" :src="userDetailInfo.icon" @click="toUserInfo"></image>
							<view class="user-info">
								<view class="flex align-center">
									<view class="user-name" @click="toUserInfo">{{ userDetailInfo.nickname  || userDetailInfo.username}}</view>
									<view class="user-tag">{{mjLevel}}</view>
								</view>
								<view class="invite-code flex align-center" @click="copy(userDetailInfo.id)">
									<text>邀请码：{{userDetailInfo.phone}}</text>
									<image src="/static/icon/icon_copy.png" />
								</view>
							</view>
						</view>
					</view>
					<view v-else>
						<view class="user-info" style="display: flex;align-items: center;">
							<!-- #ifdef H5 || APP-PLUS -->
							<image class="portrait" mode="aspectFill" src="/static/missing-face.png" @click="toLogin"></image>
							<!-- #endif -->
							<!-- #ifdef MP-WEIXIN -->
							<image class="portrait" mode="aspectFill" src="/static/missing-face.png" @click="toWeChatLogin"></image>
							<!-- #endif -->
							<!-- #ifdef MP-ALIPAY -->
							<view class="portrait"></view>
							<view><button class="login-btn" open-type="getAuthorize" @click="getALICode" hover-class="btn-hover">授权登录</button></view>
							<!-- #endif -->
							<view class="user-name" @click="toLogin">登录/注册</view>
						</view>
					</view>
				</view>
			</view>
			<view class="vip-card-box" @click="navTo('/pages/vip/privilege')">
				<image class="card-bg" src="/static/image/card-1.png" mode="widthFix"></image>
				<view class="card-text flex justify-between align-center">
					<text class="vip text-lg">{{mjLevel}}</text>
					<view class="vip-info flex align-center">
						<text class="my_vip text-sm">我的权益</text>
						<text class="cuIcon-right"></text>
					</view>
				</view>
			</view>
		</view>

		<view class="cover-container">
			<view class="tj-sction flex justify-between">
				<view class="tj-item flex flex-direction align-center justify-center" @click="navTo('../../pagesU/user/deposit')">
					<text class="num">{{ userDetailInfo.amount  || 0 }}</text>
					<text class="title">我的水晶</text>
				</view>
				<view class="tj-item flex flex-direction align-center justify-center" @click="navTo('/pages/judge/list')">
					<text class="num">{{ userDetailInfo.mjNum || 0 }}</text>
					<text class="title">品鉴卡</text>
				</view>
			</view>
			<!-- 订单 -->
			<view class="user-section">
				<view class="section-title flex justify-between align-center">
					<text class="text-lg">我的订单</text>
					<text class="cuIcon-right"></text>
				</view>
				<view class="flex align-center justify-around">
					<view class="order-item" @click="navTo('/pages/order/order?status=1')" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/icon/icon_me_obligation.png" />
						<text>待付款</text>
					</view>
					<view class="order-item" @click="navTo('/pages/order/order?status=3')" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/icon/icon_me_good.png" />
						<text>待收货</text>
					</view>
					<view class="order-item" @click="navTo('/pages/order/order?status=4')" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/icon/icon_me_complete.png" />
						<text>已完成</text>
					</view>
					<view class="order-item" @click="navTo('/pages/order/order?status=0')" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/icon/icon_me_alltasks.png" />
						<text>全部订单</text>
					</view>
				</view>
			</view>
			<!-- 常用功能 -->
			<view class="user-section">
				<view class="section-title flex justify-between align-center">
					<text class="text-lg">常用功能</text>
					<text class="cuIcon-right"></text>
				</view>
				<view class="flex align-center justify-around">
					<view class="order-item" @click="togglePopup('bottom', 'share')" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/icon/icon_me_goods.png" />
						<text>邀请好友</text>
					</view>
					<view class="order-item" @click="navTo('/pagesU/user/myTeam')" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/icon/icon_me_group.png" />
						<text>我的团队</text>
					</view>
					<view class="order-item" @click="navTo('/pages/bargain/mine?status=0')" hover-class="common-hover"
					 :hover-stay-time="50">
						<image src="/static/icon/icon_me_bargainirg.png" />
						<text>我的砍价</text>
					</view>
					<view class="order-item" @click="navTo('/pages/bargain/quickOrder?status=0')" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/icon/icon_me_nothing.png" />
						<text>我的快抢</text>
					</view>
				</view>
				<view class="flex align-center justify-around padding-top">
					<view class="order-item" @click="navTo('/pages/super/list')" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/icon/icon_me_coupons.png" />
						<text>Super专区</text>
					</view>
					<view class="order-item" @click="navTo('/pagesU/set/set')" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/icon/icon_me_safety.png" />
						<text>安全中心</text>
					</view>
					<view class="order-item" @click="navTo('../../pagesU/address/address')" hover-class="common-hover"
					 :hover-stay-time="50">
						<image src="/static/icon/icon_me_site.png" />
						<text>地址管理</text>
					</view>
					<view class="order-item" @click="watchShow = 1" hover-class="common-hover" :hover-stay-time="50">
						<image src="/static/kefu.png" />
						<text>专属客服</text>
					</view>
				</view>
			</view>
			<!-- 浏览历史 -->
			<view class="history-section icon">
				<view class="section-title flex justify-between align-center">
					<text class="text-lg">浏览历史</text>
					<text class="cuIcon-right"></text>
				</view>
				<scroll-view scroll-x class="h-list" v-if="viewList && viewList.length > 0">
					<image v-for="(item, index) in viewList" :key="index" @click="navToDetailPage(item)" :src="item.pic" mode="aspectFill"></image>
				</scroll-view>
				<!--<list-cell icon="icon-iconfontweixin" iconColor="#e07472" title="我的钱包" tips="您的会员还有3天过期"></list-cell>-->
				<!-- <list-cell icon="icon-dizhi" iconColor="#5fcda2" title="地址管理" @eventClick="navTo('../../pagesU/address/address')"></list-cell>
				<list-cell icon="icon-tuandui" iconColor="#EE82EE" title="个人资料" @eventClick="navTo('../../pagesU/user/profile')"></list-cell>
				<list-cell icon="icon-shezhi" iconColor="#0e68d7" v-if="!userDetailInfo.invitecode" title="设置邀请码" @eventClick="inputShowModal('invitecode')"></list-cell>
				<list-cell icon="icon-iconfontweixin" iconColor="#0e68d7" title="分销中心" :tips="'邀请码:'+userDetailInfo.id+',推荐人:'+userDetailInfo.job"
				 @eventClick="navTo('../../pagesU/user/invite')"></list-cell>
				<list-cell v-if="userDetailInfo.id" @eventClick="togglePopup('bottom', 'share')" icon="icon-share" iconColor="#9789f7"
				 title="分享" tips="邀请好友赢取佣金"></list-cell>

				<list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#54b4ef" title="我的收藏" @eventClick="navTo('../../pagesU/user/collect')"></list-cell> -->
				<!-- <list-cell icon="icon-share cgtt" iconColor="#0e68d7" title="商户入驻" @eventClick="navTo1('../../pagesC/store/applyBusiness')"></list-cell> -->

				<!-- <list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#0e68d7" v-if="!userDetailInfo.roomNums" title="绑定社区"
				 @eventClick="navTo1('../../pagesA/build/bindCommunity')"></list-cell>
				<list-cell icon="icon-shoucang_xuanzhongzhuangtai" iconColor="#0e68d7" v-if="userDetailInfo.roomNums" title="社区主页"
				 @eventClick="navTo('../../pagesA/build/community')"></list-cell>
				<list-cell icon="icon-shezhi1" iconColor="#e07472" title="系统设置" border="" @eventClick="navTo('../../pagesU/set/set')"></list-cell> -->
				<!-- <list-cell icon="icon-shezhi1" iconColor="#e07472" title="自定义页面测试" border="" @eventClick="navTo1('../../pagesC/store/index')"></list-cell> -->
				<!-- <list-cell icon="icon-shezhi1" iconColor="#e07472" title="test" border="" @eventClick="navTo1('../../pagesC/store/index')"></list-cell> -->
			</view>
		</view>
		<neil-modal :show="inputShow" @close="cancel" title="编辑" @cancel="cancel" @confirm="confirm">
			<input v-model="inputContent" style="margin:20upx" placeholder="请输入..." />
		</neil-modal>
		<!-- 底部分享弹窗 -->
		<uni-popup ref="showshare" :type="type">
			<!-- #ifdef H5 -->
			<shareByH5 :ifwx="ifwx" :shareType="shareType" :goodsId="userDetailInfo.id" :shareImg="userDetailInfo.icon"
			 :shareTitle="userDetailInfo.nickname" :shareContent="userDetailInfo.city" :shareHref="shareHref" @close="closeShare()"></shareByH5>
			<!-- #endif -->

			<!-- #ifdef MP-WEIXIN -->
			<shareByWx :goodsId="userDetailInfo.id" :shareType="shareType" :shareImg="userDetailInfo.icon" :shareTitle="userDetailInfo.nickname"
			 :shareContent="userDetailInfo.city" :shareHref="shareHref" @close="closeShare()"></shareByWx>
			<!-- #endif -->

			<!-- #ifdef MP-ALIPAY -->
			<shareByAli :goodsId="userDetailInfo.id" :shareImg="userDetailInfo.icon" :shareTitle="userDetailInfo.nickname"
			 :shareContent="userDetailInfo.city" :shareHref="shareHref" @close="closeShare()"></shareByAli>
			<!-- #endif -->

			<!-- #ifdef MP-TOUTIAO -->
			<shareByTt :goodsId="userDetailInfo.id" :shareImg="userDetailInfo.icon" :shareTitle="userDetailInfo.nickname"
			 :shareContent="userDetailInfo.city" :shareHref="shareHref" @close="closeShare()"></shareByTt>
			<!-- #endif -->

			<!-- #ifdef APP-PLUS || APP-PLUS-NVUE -->
			<shareByApp :goodsId="userDetailInfo.id" :shareImg="userDetailInfo.icon" :shareTitle="userDetailInfo.nickname"
			 :shareContent="userDetailInfo.city" :shareHref="shareHref" @close="closeShare()"></shareByApp>
			<!-- #endif -->
		</uni-popup>
		<mallplusCopyright></mallplusCopyright>
		<!-- 客服弹出框 -->
		<view class="weChat_popups" v-if="watchShow == 1">
			<view class="popups_bg" @click="watchShow = 0"></view>
			<view class="popups_body">
				<view class="popups_no" @click="watchShow = 0">
					<image src="/static/icon_close.png" mode=""></image>
				</view>
				<view class="popups_content">
					<view class="popups_title">客服微信</view>
					<view class="popups_phone">{{ watchNum }}</view>
					<view class="popups_btn" @click="setCopyWatch(watchNum)">复制</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
	import Api from '@/common/api';
	import listCell from '@/components/mix-list-cell';
	import neilModal from '@/components/neil-modal.vue';
	import uniPopup from "@/components/uni-popup/uni-popup.vue"
	// #ifdef H5
	import shareByH5 from '@/components/share/shareByh5.vue'
	// #endif
	// #ifdef MP-WEIXIN
	import shareByWx from '@/components/share/shareByWx.vue'
	// #endif
	// #ifdef MP-ALIPAY
	import shareByAli from '@/components/share/shareByAli.vue'
	// #endif
	// #ifdef APP-PLUS
	import shareByApp from '@/components/share/shareByApp.vue'
	// #endif
	import {
		mapState,
		mapMutations
	} from 'vuex';
	let startY = 0,
		moveY = 0,
		pageAtTop = true;
	export default {

		components: {
			uniPopup,
			// #ifdef H5
			shareByH5,
			// #endif

			// #ifdef MP-WEIXIN
			shareByWx,
			// #endif

			// #ifdef MP-ALIPAY
			shareByAli,
			// #endif

			// #ifdef APP-PLUS
			shareByApp,
			// #endif
			mallplusCopyright,
			listCell,
			neilModal
		},
		data() {
			return {
				// 客服
				watchShow: 0,
				watchNum: 'fffcc7777', // 联系客服微信
				type: '',
				inputShow: false,
				shareType: "2",
				feild: undefined,
				inputContent: '',
				coverTransform: 'translateY(0px)',
				coverTransition: '0s',
				moving: false,
				ifwx: false,
				userDetailInfo: {
					blance: 0,
					integration: 0
				},
				couponList: [],
				viewList: [],
				// 登录时保存的用户信息
				userInfos: {},
				// 用户等级
				mjLevel: '',
				// 接口请求的用户信息
				usersinfo: {}
			};
		},
		async onLoad() {
			this.ifwx = this.$common.isWeiXinBrowser()
			this.getData()
			this.userInfos = uni.getStorageSync('userInfos') || '';
		},
		async onShow() {
			this.getData()
		},
		onShareAppMessage(res) {
			return {
				title: '我是' + this.userDetailInfo.nickname + ',注册会员,立享佣金!',
				imageUrl: this.userDetailInfo.icon,
				path: '/pages/public/reg?id=' + this.userDetailInfo.id
			}
		},
		// #ifndef MP
		onNavigationBarButtonTap(e) {
			const index = e.index;
			if (index === 0) {
				this.navTo('../../pagesU/set/set');
			} else if (index === 1) {
				// #ifdef APP-PLUS
				const pages = getCurrentPages();
				const page = pages[pages.length - 1];
				const currentWebview = page.$getAppWebview();
				currentWebview.hideTitleNViewButtonRedDot({
					index
				});
				// #endif
				uni.navigateTo({
					url: '../../pagesU/notice/notice'
				});
			}
		},
		// #endif

		computed: {
			...mapState(['userInfo']),
			// 获取店铺联系人手机号
			kfmobile() {
				return '13146587722' || 0;
			},
			shareHref() {
				let pages = getCurrentPages()
				let page = pages[pages.length - 1]
				// #ifdef H5 || MP-WEIXIN || APP-PLUS || APP-PLUS-NVUE
				return Api.BASEURI.replace("/api/", "") + '/#/pages/public/reg?id=' + this.userDetailInfo.id;
				// #endif
				// #ifdef MP-ALIPAY
				return Api.BASEURI.replace("/api/", "") + '/#/pages/public/reg?id=' + this.userDetailInfo.id;
				// #endif
			}
		},
		methods: {
			...mapMutations(['logout']),
			inputShowModal(feild) {
				this.feild = feild;
				this.inputShow = true;
				this.inputContent = '';
			},
			// 复制客服微信
			setCopyWatch(watchNum) {
				var that = this;
				if (watchNum != '') {
					// 如果data 是默认值时不复制
					uni.setClipboardData({
						data: watchNum,
						success: function() {
							uni.showToast({
								title: '复制成功!',
								duration: 1000
							});

							setTimeout(() => {
								that.watchShow = 0;
							}, 1000);
						}
					});
				}
			},
			copy(e) {
				uni.setClipboardData({
					data: e,
					success: function() {
						this.$api.msg('复制成功！')
					}
				});
			},
			cancel() {
				this.inputShow = false;
			},
			confirm() {
				const that = this;
				if (!that.inputContent) {
					that.$api.msg('输入不能为空');
					return;
				}
				let obj = {
					id: this.userDetailInfo.id
				};
				obj[that.feild] = that.inputContent;
				Api.apiCall('post', Api.member.updateMember, obj);
				that.$api.msg('修改成功');
				that.userInfos[that.feild] = that.inputContent
			},
			togglePopup() {
				uni.navigateTo({
					url:'./share'
				})
			},
			closeShare() {
				this.$refs.showshare.close();
			},
			async getData() {
				this.getuserinfo();
				this.getHistory();
			},
			// 获取用户详情
			async getuserinfo() {
				this.userInfos = uni.getStorageSync('userInfos') || '';
				let params = {
					id: this.userInfos.id
				};
				let data1 = await Api.apiCall('get', Api.index.userInfo, params);
				// let token = uni.getStorageSync('token') || '';
				// //console.log('用户详情接口', data1)
				if (!data1.member) {
					//未登录数据处理
					this.userDetailInfo = {
						blance: 0,
						integration: 0
					};
					this.couponList = [];
					this.viewList = [];
					this.logout();
				} else {
					uni.setStorageSync('userInfos', data1.member);
					if (data1.member.job == null) {
						data1.member.job = '无'
					}
					this.userDetailInfo = data1.member;
					if (this.userDetailInfo.mjLevel == 0) {
						this.mjLevel = '普通会员'
					} else if (this.userDetailInfo.mjLevel == 1) {
						this.mjLevel = '导购'
					} else {
						this.mjLevel = '店长'
					}
					// //console.log('用户信息123',this.userDetailInfo)
					let couponList = data1.histories;
					this.couponList = couponList;
				}
			},
			// 获取浏览历史
			async getHistory() {
				let token = uni.getStorageSync('token') || '';
				if (token) {
					let params = {};
					let data = await Api.apiCall('get', Api.goods.viewList, params);
					this.viewList = data.result;
				}
			},
			customerService() {
				uni.navigateTo({
					url: '../../pagesU/help/help'
				})
			},
			toUserInfo() {
				uni.navigateTo({
					url: '../../pagesU/user/profile'
				});
				// window.location.href = 'http://115.29.240.152:8080/#/?phone=18039698719&id=46'
			},

			toWeChatLogin() {
				uni.navigateTo({
					url: '/pages/public/login',
				});
			},

			//详情页
			navToDetailPage(item) {
				//测试数据没有写id，用title代替
				let id = item.id;
				uni.navigateTo({
					url: `../../pagesA/product/product?id=${id}`
				});
			},
			/**
			 * 统一跳转接口,拦截未登录路由
			 * navigator标签现在默认没有转场动画，所以用view
			 */
			navTo(url) {
				let token = uni.getStorageSync('token') || '';
				if (!token) {
					url = '/pages/public/login';
				}
				uni.navigateTo({
					url: url
				});
			},
			navTo1(url) {

				uni.navigateTo({
					url: url
				});
			},
			/**
			 *  会员卡下拉和回弹
			 *  1.关闭bounce避免ios端下拉冲突
			 *  2.由于touchmove事件的缺陷（以前做小程序就遇到，比如20跳到40，h5反而好很多），下拉的时候会有掉帧的感觉
			 *    transition设置0.1秒延迟，让css来过渡这段空窗期
			 *  3.回弹效果可修改曲线值来调整效果，推荐一个好用的bezier生成工具 http://cubic-bezier.com/
			 */
			coverTouchstart(e) {
				if (pageAtTop === false) {
					return;
				}
				this.coverTransition = 'transform .1s linear';
				startY = e.touches[0].clientY;
			},
			coverTouchmove(e) {
				moveY = e.touches[0].clientY;
				let moveDistance = moveY - startY;
				if (moveDistance < 0) {
					this.moving = false;
					return;
				}
				this.moving = true;
				if (moveDistance >= 80 && moveDistance < 100) {
					moveDistance = 80;
				}

				if (moveDistance > 0 && moveDistance <= 80) {
					this.coverTransform = `translateY(${moveDistance}px)`;
				}
			},
			coverTouchend() {
				if (this.moving === false) {
					return;
				}
				this.moving = false;
				this.coverTransition = 'transform 0.3s cubic-bezier(.21,1.93,.53,.64)';
				this.coverTransform = 'translateY(0px)';
			},
			getUserInfo(e) {
				let _this = this;
				//return false;
				//console.log('eeeee', e)
				if (e.detail.errMsg == 'getUserInfo:fail auth deny') {
					_this.$common.errorToShow('未授权');
				} else {
					var data = {
						open_id: _this.open_id,
						iv: e.detail.iv,
						edata: e.detail.encryptedData,
						signature: e.detail.signature
					};
					//有推荐码的话，带上
					var invitecode = _this.$db.get('invitecode');
					if (invitecode) {
						data.invitecode = invitecode;
					}
					_this.toWxLogin(data);
				}
			},
			getALICode() {
				let that = this;
				uni.login({
					scopes: 'auth_user',
					success: res => {
						if (res.authCode) {
							uni.getUserInfo({
								provider: 'alipay',
								success: function(infoRes) {
									if (infoRes.errMsg == 'getUserInfo:ok') {
										let user_info = {
											nickname: infoRes.nickName,
											avatar: infoRes.avatar
										};
										that.aLiLoginStep1(res.authCode, user_info);
									}
								},
								fail: function(errorRes) {
									this.$common.errorToShow('未取得用户昵称头像信息');
								}
							});
						} else {
							this.$common.errorToShow('未取得code');
						}
					},
					fail: function(res) {
						this.$common.errorToShow('用户授权失败my.login');
					}
				});
			},
			getWxCode(e) {
				//console.log('-------', e)
				let that = this;
				uni.login({
					provider: 'weixin',
					success: function(res) {
						if (res.code) {
							//console.log(res.code)
							that.wxLoginStep1(res.code);
						} else {
							this.$common.errorToShow('未取得code');
						}
					},
					fail: function(res) {
						this.$common.errorToShow('用户授权失败wx.login');
					}
				});
			},
			wxLoginStep1(code) {
				var data = {
					code: code
				}
				this.$api.login1(data, res => {
					if (res.status) {
						this.open_id = res.data;

						this.getUserInfo()
					} else {
						this.$common.errorToShow(res.msg, function() {
							uni.navigateBack({
								delta: 1
							});
						});
					}
				});
			},
			aLiLoginStep1(code, user_info) {
				let data = {
					code: code,
					user_info: user_info
				};
				this.$api.alilogin1(data, res => {
					this.alipayNoLogin = false;
					if (res.status) {
						this.open_id = res.data.user_wx_id;
						//判断是否返回了token，如果没有，就说明没有绑定账号，跳转到绑定页面
						if (!res.data.hasOwnProperty('token')) {
							this.$common.redirectTo('/pages/public/index?user_wx_id=' + res.data.user_wx_id);
						} else {
							this.$db.set('userToken', res.data.token);
							this.initData();
						}
					} else {
						this.$common.errorToShow(res.msg);
					}
				});
			},
			toWxLogin(data) {
				//console.log('----------data---------', data);
				let _this = this;
				_this.$api.login2(data, function(res) {
					if (res.status) {
						//判断是否返回了token，如果没有，就说明没有绑定账号，跳转到绑定页面
						if (typeof res.data.token == 'undefined') {
							uni.redirectTo({
								url: '/pages/public/index?user_wx_id=' + res.data.user_wx_id
							});
						} else {
							_this.$db.set('userToken', res.data.token);
							_this.initData();
						}
					} else {
						_this.$common.errorToShow('登录失败，请重试');
					}
				});
			},
			toLogin() {
				uni.navigateTo({
					url: '/pages/public/login'
				});
			}, //在线客服,只有手机号的，请自己替换为手机号
			showChat() {
				// #ifdef H5
				let _this = this;
				window._AIHECONG('ini', {
					entId: this.config.ent_id,
					button: false,
					appearance: {
						panelMobile: {
							tone: '#FF7159',
							sideMargin: 30,
							ratio: 'part',
							headHeight: 50
						}
					}
				});
				//传递客户信息
				window._AIHECONG('customer', {
					head: _this.userInfo.avatar,
					名称: _this.userInfo.nickname,
					手机: _this.userInfo.mobile
				});
				window._AIHECONG('showChat');
				// #endif

				// 拨打电话
				// #ifdef APP-PLUS
				if (this.kfmobile) {
					uni.makePhoneCall({
						phoneNumber: '' + this.kfmobile,
						success: () => {
							// //console.log("成功拨打电话")
						}
					});
				} else {
					this.$common.errorToShow('商户未设置客服手机号');
				}
				// #endif
			}
		}
	};
</script>
<style lang="scss">
	@font-face {
		font-family: cgtt;
		font-weight: normal;
		font-style: normal;
		src: url('//at.alicdn.com/t/font_1475801_5innv59qqcr.ttf') format('truetype'),
	}

	page {
		background: #F3F3F3;
	}

	// 客服弹出框
	.weChat_popups {
		z-index: 999;
		position: fixed;
		left: 0;
		top: 0;
		width: 100vw;
		height: 100vh;

		.popups_bg {
			z-index: 1000;
			position: absolute;
			left: 0;
			top: 0;
			width: 100vw;
			height: 100vh;
			background-color: #000;
			opacity: 0.3;
		}

		.popups_body {
			z-index: 1001;
			position: absolute;
			right: 0;
			left: 0;
			top: 0;
			bottom: 0;
			margin: auto;
			width: 600upx;
			height: 462upx;
			border-radius: 30upx;
			background-color: #FFFFFF;

			.popups_no {
				position: absolute;
				right: 20upx;
				top: 20upx;
				width: 32upx;
				height: 32upx;
				display: flex;
				align-items: center;
				justify-content: center;

				image {
					width: 32upx;
					height: 32upx;
				}
			}

			.popups_content {
				width: 100%;
				height: 100%;
				padding: 0 30upx;
				padding-top: 30upx;
				padding-bottom: 30upx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				.popups_title {
					margin-top: 30upx;
					// margin-bottom: 60upx;
					font-size: 36upx;
					text-align: center;
				}

				.popups_phone {
					font-size: 40upx;
					text-align: center;
					font-weight: 500;
				}

				.popups_btn {
					width: 100%;
					height: 88upx;
					line-height: 88upx;
					background-color: #AD1E22;
					font-size: 36upx;
					border-radius: 44upx;
					line-height: 88upx;
					text-align: center;
					color: #FFFFFF;
				}
			}
		}
	}


	.cgtt {
		font-family: "cgtt" !important;
		font-size: 16px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	.icon-userShare:before {
		content: "\c600";
	}

	.icon-userJoin:before {
		content: "\c601";
	}

	%flex-center {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	%section {
		display: flex;
		justify-content: space-around;
		align-content: center;
		background: #fff;
		border-radius: 10upx;
	}

	.sign-point {
		position: absolute;
		right: 100rpx;
		text-align: center;
		color: #fff;
	}

	.sign-point-text {
		font-size: 22rpx;
		margin-top: 4rpx;
	}

	.sign-point .iconfont {
		color: #fff;
		background: rgba(0, 0, 0, 0.1);
		width: 72rpx;
		height: 72rpx;
		text-align: center;
		line-height: 72rpx;
		border-radius: 50%;
		display: inline-block;
	}

	.customer-service {
		position: absolute;
		right: 0rpx;
		text-align: center;
		color: #fff;
	}

	.customer-service-text {
		font-size: 22rpx;
		margin-top: 4rpx;
	}

	.customer-service .iconfont {
		color: #fff;
		background: rgba(0, 0, 0, 0.1);
		width: 72rpx;
		height: 72rpx;
		text-align: center;
		line-height: 72rpx;
		border-radius: 50%;
		display: inline-block;
	}

	.user-page {
		height: 560upx;
		padding: 100upx 30upx 0;
		position: relative;
		background: linear-gradient(to left, #212D5E, #070D26);

		.bg {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 100%;
			filter: blur(1px);
			// opacity: 0.7;
		}

		.heard-icon {
			position: absolute;
			top: -50upx;
			right: 30upx;

			image {
				width: 44upx;
				height: 44upx;
				margin-left: 60upx;
			}
		}
	}

	.user-info-box {
		height: 160upx;
		display: flex;
		align-items: center;
		position: relative;
		z-index: 1;
		margin-top: 40upx;

		.portrait {
			width: 130upx;
			height: 130upx;
			border: 5upx solid #fff;
			border-radius: 50%;
		}

		.user-info {
			margin-left: 26upx;
			color: #fff;

			.user-name {
				font-size: 42upx;
			}

			.user-tag {
				height: 38upx;
				min-width: 120upx;
				line-height: 38upx;
				text-align: center;
				margin-left: 20upx;
				background: linear-gradient(to right, #FF7777, #FF1D1D);
				border-radius: 19upx;
				border-top-left-radius: 0;
				font-size: 22upx;
			}

			.invite-code {
				font-size: 28upx;
				margin-top: 18upx;

				image {
					margin-left: 30upx;
					width: 32upx;
					height: 32upx;
				}
			}
		}
	}

	.login-btn {
		color: #fff;
		width: 180upx;
		height: 50upx;
		line-height: 50upx;
		border-radius: 25upx;
		background: #ff7159;
		font-size: 12px;
	}

	.vip-card-box {
		position: relative;
		margin-top: 40upx;

		.card-bg {
			width: 100%;
		}

		.card-text {
			color: $font-color-333;
			padding: 0 24upx;
			position: absolute;
			width: 80%;
			top: 15%;
			left: 20%;
		}
	}

	.cover-container {
		background: $page-color-base;
		margin-top: -130upx;
		position: relative;
		background: #f5f5f5;
		padding-bottom: 20upx;
		border-radius: 20upx;
	}

	.tj-sction {
		border-radius: 20upx;
		padding: 30upx 40upx;
		background: #fff;

		.tj-item {
			width: calc(50% - 15upx);
			border-radius: 14upx;
			height: 160upx;
			box-shadow: 0 0 5px rgba($color: #D9104D, $alpha: 0.14);
		}

		.num {
			font-size: 52upx;
		}

		.title {
			font-size: 28upx;
			color: #999;
			padding-top: 12upx;
		}
	}

	.user-section {
		background: #fff;
		padding: 30upx 30upx 50upx;
		margin-top: 20upx;
		border-radius: 20upx;

		.section-title {
			margin-bottom: 30upx;
		}

		.order-item {
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			width: 120upx;
			height: 120upx;
			border-radius: 10upx;
			font-size: $font-sm;
			color: $font-color-dark;

			image {
				width: 54upx;
				height: 54upx;
				margin-bottom: 20upx;
			}
		}

		.yticon {
			font-size: 48upx;
			margin-bottom: 18upx;
			color: #fa436a;
		}

		.icon-shouhoutuikuan {
			font-size: 44upx;
		}
	}

	.history-section {
		padding: 30upx 0;
		margin-top: 20upx;
		background: #fff;
		border-radius: 20upx;

		.section-title {
			padding: 0 30upx;
		}

		.sec-header {
			display: flex;
			align-items: center;
			font-size: $font-base;
			color: $font-color-dark;
			line-height: 40upx;
			margin-left: 30upx;

			.yticon {
				font-size: 44upx;
				color: #5eba8f;
				margin-right: 16upx;
				line-height: 40upx;
			}
		}

		.h-list {
			white-space: nowrap;
			padding: 30upx 30upx 0;

			image {
				display: inline-block;
				width: 160upx;
				height: 160upx;
				margin-right: 20upx;
				border-radius: 10upx;
			}
		}
	}
</style>
